package dms.service.imp;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import dms.model.Building;
import dms.model.School;
import dms.model.form.DormitoryChange;

import dms.model.role.Student;
import dms.model.util.PageIterator;
import dms.repository.DormitoryChangeRepository;
import dms.service.DormitoryChangeQueryService;

public class DormityChangeQueryServiceImpl implements
		DormitoryChangeQueryService {
private static final Log log = LogFactory.getLog(RepairQueryServiceImpl.class);
	
	private DormitoryChangeRepository dormitoryChange = null;
	

	public DormitoryChangeRepository getDormitoryChange() {
		return dormitoryChange;
	}

	public void setDormitoryChange(DormitoryChangeRepository dormitoryChange) {
		this.dormitoryChange = dormitoryChange;
	}

	public PageIterator<DormitoryChange> findBySchool(int start, int count,
			School school, Date from, Date to) {
		
		return this.dormitoryChange.findBySchool(start, count, school, null, null);
	}

	public DormitoryChange findChangeByID(Long id) {
	
		return this.dormitoryChange.findById(id);
	}

	@Override
	public PageIterator<DormitoryChange> findBySchoolAndProcessed(int start,
			int count, School school, Date fromDate, Date toDate,
			Boolean processed, Boolean applied) {
		return this.findBySchoolAndProcessed(start, count, school, fromDate, toDate, processed, applied);
	}

	@Override
	public PageIterator<DormitoryChange> findBySchoolAndProcessed(int start,
			int count, School school, Boolean processed, Boolean applied) {
		// TODO Auto-generated method stub
		return this.dormitoryChange.findBySchool(start, count, null, null, school, processed, applied);
	}
	
	public PageIterator<DormitoryChange> findByStudentAndDate(int start,
			int count, Date fromDate, Date toDate, Student student) {
		return this.dormitoryChange.findByStudent(start, count, student, fromDate, toDate);
	}

}
